package engine.graphics.shader
{
	import engine.core.*;
	import engine.math.*;
	import flash.display3D.*;
	
	public class RxShaderConstDefs
	{
		private var m_constIndices:Vector.<uint>;
		private var m_constValues:Vector.<RxShaderConst>;
		
		public function RxShaderConstDefs()
		{
			this.m_constIndices = new Vector.<uint>;
			this.m_constValues = new Vector.<RxShaderConst>;
		}
		
		public function ParseAsm(param1:String) : String
		{
			var _loc_2:RegExp = null;
			var _loc_3:Array = null;
			var _loc_4:uint = 0;
			var _loc_5:RxShaderConst = null;
			while (param1 != null && param1 != "")
			{
				
				_loc_2 = new RegExp("def\\s+[vf]c(\\d+),\\s*(" + RxUtilities.s_regExpFloat.source + ")\\s*,\\s*(" + RxUtilities.s_regExpFloat.source + ")\\s*,\\s*(" + RxUtilities.s_regExpFloat.source + ")\\s*,\\s*(" + RxUtilities.s_regExpFloat.source + ")\\s*[\\n\\r]+(.*)", "s");
				_loc_3 = param1.match(_loc_2);
				if (_loc_3 == null || _loc_3.length != 7)
				{
					break;
				}
				_loc_4 = uint(_loc_3[1]);
				_loc_5 = new RxShaderConst(Number(_loc_3[2]), Number(_loc_3[3]), Number(_loc_3[4]), Number(_loc_3[5]));
				this.AddConstValue(_loc_4, _loc_5);
				param1 = String(_loc_3[6]);
			}
			return param1;
		}
		
		public function AddConstValue(param1:uint, param2:RxShaderConst) : void
		{
			this.m_constIndices.push(param1);
			this.m_constValues.push(param2);
		}
	}
}